<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="/common/jsp/global.jsp"%>
<div class="wrapper-md" ng-controller="configTableListCtrl">
    <div >
        <!-- breadcrumb -->
        <ul class="breadcrumb bg-white b-a">
            <li ><i class="glyphicon glyphicon-list"></i>表结构设计</li>
        </ul>
        <!-- / breadcrumb -->
    </div>
    <div class="panel panel-default">

        <div class="row wrapper">
            <div class="col-sm-5 m-b-xs">
                <div class="input-group">
                    <input type="text" class="input-sm form-control" placeholder="Search" ng-model="searchKey" ng-init="searchKey='${param.searchKey}'">
                      <span class="input-group-btn">
                        <button class="btn btn-sm btn-default" type="button" ng-search><i class="glyphicon glyphicon-search"></i></button>
                      </span>
                </div>
            </div>
            <div class="col-sm-7">
                <div class="pull-right">
                    <button type="button" class="btn btn-default " ui-sref="tableAdd({module:'${param.module}'})">新建</button>
                    <c:if test="${not empty param.module}">
                        <button type="button" class="btn btn-default " ng-click="autoCode('${param.module}')">生成代码</button>
                    </c:if>
                    <c:if test="${not empty param.module}">
                        <button type="button" class="btn btn-default " ng-click="downCode('${param.module}')">下载</button>
                    </c:if>
                    <button type="button" class="btn btn-default " ng-refresh >刷新</button>
                </div>

            </div>
        </div>
        <div class="table-responsive">
            <table class="table table-striped b-t b-light">
                <thead>
                <tr>
                    <th style="width:20px;">
                        <label class="i-checks m-b-none">
                            <input type="checkbox" ng-all-checkbox="tableIds"><i></i>
                        </label>
                    </th>

                    <th width="20px">序号</th>

                    <th>表名</th>
                    <th>描述</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                    <c:forEach items="${tableList}" var="table" varStatus="status">
                         <tr>
                             <td><label class="i-checks m-b-none"><input type="checkbox" name="tableIds" ng-checkbox value="${table.tableName}"><i></i></label></td>
                             <td>${status.index+1}</td>
                             <td>${table.tableName} </td>
                             <td>${table.tableInfo} </td>
                             <td>${table.status} </td>
                             <td>
                                 <%--<a ui-sref="tableLook({module:'${param.module}',name:'${table.tableName}'})"><span class="font-bold" >查看</span>  </a>--%>
                                 <a ui-sref="tableEdit({module:'${param.module}',name:'${table.tableName}'})"><span class="font-bold" >编辑</span>  </a>
                                 <a ng-click="tableDelete('${param.module}','${table.tableName}')"><span class="font-bold" >删除</span>  </a>

                             </td>
                         </tr>
                    </c:forEach>

                </tbody>
            </table>

        </div>
        <iframe id="downFrame" width="0" height="0" ng-src="{{table.downURL}}"></iframe>

    </div>
</div>
